<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function extend(sub, sup) {
            sub.prototype = Object.create(sup.prototype);
            Object.defineProperty(sub.prototype, 'constructor', {
                value: sub,
                enumerable: false
            })
        }
        function User(name, age) {
            this.name = name;
            this.age = age;
        }
        User.prototype.show = function () {
            console.log(this.name, this.age)
        }
        const Request = {
            ajax() {
                console.log('请求后台')
            }
        }
        const Address = {
            getAddress() {
                console.log('获取地址')
            }
        }
        function Member(...args) {
            User.apply(this, args);
        }
        extend(Member, User);
        
        Member.prototype = Object.assign(Member.prototype, Request, Address)
        let lisi = new Member('李思', 20)
        lisi.show();
        lisi.ajax();
        lisi.getAddress();
    </script>
</body>

</html>